import * as React from 'react';
import { Text, View, TextInput,StyleSheet, Image,
    TouchableOpacity,ScrollView
} from 'react-native';
import { WebView } from 'react-native-webview';

export default class Topic extends React.Component {
    constructor(props){
        super(props);
        this.state = {
            data: this.props.data
        };
    }
    render() {
        let data = this.state.data;
        let data0 = data[0];
        let data1 = data[1];
        return (
            <View style={styles.tj}>
                <View style={styles.tjTitle}>
                    <Text style={styles.bigText}>推荐专题</Text>
                </View>
                <View style={[styles.row,styles.tjTopic]}>
                    <TouchableOpacity style={[styles.tjTopicItem, {marginRight:5}]} >
                        <Image source={{uri: data0.img}} resizeMode="stretch" style={styles.img}/>
                    </TouchableOpacity>

                    <TouchableOpacity style={[styles.tjTopicItem, {marginLeft:5}]} >
                        <Image source={{uri: data1.img}} resizeMode="stretch" style={styles.img}/>
                    </TouchableOpacity>
                </View>
                <TouchableOpacity style={styles.tjTQ} >
                    <Text style={styles.tjTQText}>查看同期专题 &gt; </Text>
                </TouchableOpacity>
            </View>
        );
    }
    _showList(){
    }
    _showDetail(title, url){
    }
}
const styles = StyleSheet.create({
    tj:{
        marginTop:-5,
        marginLeft:10,
        marginRight:10
    },
    tjTitle:{

    },
    bigText:{
        fontSize:17,
        fontWeight: '300',
        marginBottom: 5
    },
    row:{
        flexDirection: 'row'
    },
    tjTopic:{
        marginTop:10
    },
    tjTopicItem:{
        height: 100,
        flex:1,
        borderRadius:5
    },
    tjTQ:{
        marginTop:10
    },
    tjTQText:{
        fontWeight: '300',
        fontSize:15,
        color: '#7D7D81'
    },
    img:{
        height:100,borderRadius:5
    }
});
//Z自定义组件封装导出
module.exports = Topic
